import { createApp } from 'vue'
import { createPinia } from 'pinia'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import App from './App.vue'
import router from './router'
import './assets/css/index.css'
import { ElLoading } from 'element-plus'

// import i18n from './utils/lang'

import 'default-passive-events' // 消除echarts滚动出现的警告问题

// const user = {
//   id: 1,
//   role: 'level1' // 初始权限为一级
// }

// 注册持久化插件
const pinia = createPinia()

const app = createApp(App)

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  //引入所有的ele icon
  app.component(key, component)
}

// app.provide('user', user) // 注册全局变量
app.use(pinia)
// app.use(i18n)
app.use(router)
app.use(ElLoading)
app.mount('#app')
